import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'index',
    component: () => import('@/components/HelloWorld')
  },
  {
    path: '/qianyan',
    name: 'qianyan',
    component: () => import('@/components/Qianyan')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/HomeView')
  }
]

const router = createRouter({
  // mode: process.env.IS_ELECTRON ? 'hash' : 'history',
  // history: createWebHistory(process.env.BASE_URL),
  history: process.env.IS_ELECTRON ? createWebHashHistory(process.env.BASE_URL) : createWebHistory(process.env.BASE_URL),
  routes
})

export default router